/*jslint node:true nomen:true*/
'use strict';

//global variable
console.log(__filename);
console.log(__dirname);

//setTimeout
setTimeout(function () {
    console.log('setTimeout 1s');
}, 1000);

var t = setTimeout(function () {
    console.log('this will not log');
}, 1000);

clearTimeout(t);

//setInterval
var i = setInterval(function () {
    console.log("setInterval");
}, 3000);

setTimeout(function () {
    clearInterval(i);
    console.log("clear Interval");
}, 12000);

//console
console.log("Today is %d, %d", 7, 12);
console.trace();
console.time("check time");
setTimeout(function () {
    console.timeEnd("check time");
}, 1000);

//process
//output
process.stdout.write('Hello World!' + '\n');
//read arg
process.argv.forEach(function (val, index, array) {
    console.log(index + ':' + val);
});
//exec path
console.log(process.execPath);
//platform
console.log(process.platform);
//current dir
console.log(process.cwd());
//current version
console.log(process.version);
//memory
console.log(process.memoryUsage());
//exit event
process.on('exit', function (code) {
    setTimeout(function () {
        console.log('never reach code');
    }, 0);
    console.log('exit code:' + code);
});

console.log('program exit');

















